Document the Strings format function in ext/README.md - #1473
Open
Sanjays2402 wants to merge 2 commits into
Open
Conversation
The Strings extension supports <string>.format(<list>) since version 1 (ext/strings.go), but the function was accidentally omitted from the documented Strings functions in ext/README.md. This adds the missing documentation entry, matching the implementation's documented behavior, with example outputs verified against the interpreter. Fixes cel-expr#1116
Collaborator
|
/gcbrun |
Collaborator
|
/gcbrun |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1116
The Strings extension supports
<string>.format(<list>)since version 1(ext/strings.go), but the function was accidentally omitted from the
documented Strings functions in ext/README.md. This adds the missing
documentation entry, matching the implementation's documented behavior.
Test evidence:
the new README section was evaluated against the interpreter
(
cel.NewEnv(ext.Strings())) and the documented outputs verified:"this is a string: %s and an integer: %d".format(["str", 42])->"this is a string: str and an integer: 42""%f".format([3.14])->"3.140000""5 in binary: %b".format([5])->"5 in binary: 101""26 in hex: %x".format([26])->"26 in hex: 1a""26 in hex (uppercase): %X".format([26])->"26 in hex (uppercase): 1A""30 in octal: %o".format([30])->"30 in octal: 36""duration: %s".format([duration("1h45m47s")])->"duration: 6347s"